﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;


namespace HomeStayWebCP.Models.BusinessObject
{
    public partial class PostObject
    {
        public PostObject()
        {
            //this.Comments = new HashSet<Comment>();
            //this.Likes = new HashSet<Like>();
            //this.Images = new HashSet<Image>();

        }

        public int PostID { get; set; }
        public string Username { get; set; }

        [Required(ErrorMessage = "Title is required")]
        [StringLength(80,MinimumLength = 10,ErrorMessage = "Title must be  in 10-80 characters")]
        public string Title { get; set; }

        public string Content { get; set; }
        public int HouseID { get; set; }

        [Required(ErrorMessage = "Contact Name is required")]
        [StringLength(30, ErrorMessage = "Contact Name must be under 30 characters")]
        public string ContactName { get; set; }

        [Required(ErrorMessage = "MobilePhone is required")]
        [RegularExpression("^[0-9]{9,15}$",ErrorMessage = "Phone number field just contain number 9-15 digits")]
        public string MobilePhone { get; set; }


        [RegularExpression("^[0-9]{9,15}$", ErrorMessage = "Phone number field just contain number 9-15 digits")]
        public string TelePhone { get; set; }

        [Email(ErrorMessage = "Email has to follow format abc@abc.com")]
        [Required(ErrorMessage = "Email is required")]
        public string Email { get; set; }

        public bool Available { get; set; }
        public DateTime TimeCreated { get; set; }
        public int Status { get; set; }
        public string ReviewBy { get; set; }
        public Nullable<System.DateTime> ReviewDate { get; set; }
        public bool IsDeleted { get; set; }
        public int HomeStayTypeID { get; set; }

        public virtual HouseObject House { get; set; }
    }
}